Applescript Variable Error
Hi all,
I am trying to write an applescript that is called with a variable and then uses that variable in the script. For example:
on run argv
set a to item 1 of argv
tell application "iTerm-2"
tell current window
tell the current session
write text "ssh" & a
end tell
end tell
end tell
end run
So the app would be called on the command line: open mypp.app --args machine. The app iTerm-2 would open and run the command "ssh machine". At the moment it launches iTerm-2 and runs the ssh command but ignores the variable. Am I called the variable of "a" incorrectly?
Thanks,
Sam